package com.ccx.coachsite.http;

import com.ccx.coachsite.util.StringUtil;

public class HttpErrorDesc {
	public static String getDesc(int states)
	{
		String desc = null;
		switch(states)
		{
		case 361:
			desc = "手机号码为空";
			break;
		case 362:
			desc = "手机号码不合法";
			break;
		case 363:
			desc = "短信码发送失败";
			break;
		case 214:
			desc = "手机号码不合法";
			break;
		case 215:
			desc = "号码已经注册过";
			break;
		case 218:
			desc = "验证码已经失效";
			break;
		case 219:
			desc = "验证码校验失败";
			break;
		case 224:
			desc = "手机号码不合法";
			break;
		case 225:
			desc = "号码不存在";
			break;
		case 226:
			desc = "密码错误";
			break;
		case 228:
			desc = "绑定的uid为空";
			break;
		case 233:
			desc = "第三方授权链接异常";
			break;
		case 235:
			desc = "未绑定手机，请绑定手机号码";
			break;
		case 323:
			desc = "手机号码不合法";
			break;
		case 324:
			desc = "不存在该手机号码的信息";
			break;
		case 211:
			desc = "您的手机号码未注册";
			break;
		case 221:
			desc = "您的手机号码未注册";
			break;
		case 231:
			desc = "账号已停用";
			break;
		}
		
		return desc;
	}
	
	public static void setErrorDesc(int states, BaseResp resp)
	{
		String desc = getDesc(states);
		resp.setErrorCode(Integer.toString(states));
		if(!StringUtil.isEmpty(desc))
		{
			resp.setDesc(desc);
		}
	}
}
